package com.bwie.sevice.impl;

import com.bwie.mapper.OrderMapper;
import com.bwie.pojo.Order;
import com.bwie.sevice.OrderService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * description:
 *
 * @Author caoshuaifeng
 * @Create 2025/3/31 08:55
 * @Version 1.0
 */
@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;
    @Override
    public R joinGroup(Order order) {
        return null;
    }

    @Override
    public R getPrizeList() {
        List<Order> orders = orderMapper.selectList(null);
        return R.OK(orders);
    }

    @Override
    public R addPrize(Order order) {
         orderMapper.insert(order);
        return R.OK();
    }

    @Override
    public R updatePrize(Order order) {
        orderMapper.updateById(order);
        return R.OK();
    }

    @Override
    public R deletePrize(Integer id) {
        orderMapper.deleteById(id);
        return R.OK();
    }
}
